package com.cloud.salon.client.business.service.impl;

import com.cloud.salon.common.base.response.Res;
import com.cloud.salon.common.crud.service.impl.CRUDServiceImpl;
import com.cloud.salon.client.business.repository.PaymentRepository;
import com.cloud.salon.client.business.service.PaymentService;
import com.cloud.salon.common.base.entity.business.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description 付款Service实现类
 * @Author wolf--LZH
 * @CreateDate 2019/4/10 0010 下午 1:30
 */
@Service
public class PaymentServiceImpl extends CRUDServiceImpl<Payment, PaymentRepository> implements PaymentService {

	@Autowired
	private PaymentRepository repository;

	public Res<List<Payment>> findByRecord(Integer recordId) {
		List<Payment> payments = repository.findByRecordId(recordId);
		if (payments == null)
			return new Res(-3, "查询失败,请稍后再试");
		return new Res(0, "获取成功", payments);
	}
}
